package com.kitty.game.confirm.service.handler;

import com.kitty.game.role.model.Role;
import com.kitty.common.utils.SpringUtils;
import com.kitty.game.activity.service.task.ShuaDaoTaskHandler;
import com.kitty.game.confirm.model.FetchShuaDaoRewardConfirm;
import com.kitty.game.team.message.ReqConfirmResult;
import org.springframework.stereotype.Component;

@Component
public class FetchShuaDaoRewardConfirmHandler extends ConfirmHandler {
    @Override
    public void handleConfirmResult(Role role, ReqConfirmResult reqConfirmResult) {
        if ("1".equals(reqConfirmResult.getSelect())) {
            FetchShuaDaoRewardConfirm confirm = (FetchShuaDaoRewardConfirm)role.getConfirm();
            SpringUtils.getBean(ShuaDaoTaskHandler.class).fetchReward(role, confirm.getType(), confirm.getIndex());
        }
    }
}
